#!/bin/bash

# 修复重复的Smart前缀问题
echo "🔧 修复重复的Smart前缀问题..."

# 修复SmartSmartAgentConfigManager -> SmartAgentConfigManager
echo "修复SmartSmartAgentConfigManager..."
find src/examples -name "*.cj" -exec sed -i '' 's/SmartSmartAgentConfigManager/SmartAgentConfigManager/g' {} \;

# 修复createSmartProviderConfig -> createSmartAgent
echo "修复createSmartProviderConfig..."
find src/examples -name "*.cj" -exec sed -i '' 's/createSmartProviderConfig/createSmartAgent/g' {} \;

# 修复resolveSmartProviderConfig -> resolveProviderConfig
echo "修复resolveSmartProviderConfig..."
find src/examples -name "*.cj" -exec sed -i '' 's/resolveSmartProviderConfig/resolveProviderConfig/g' {} \;

echo "✅ 重复前缀修复完成！"

# 检查修复结果
echo "🔍 检查修复结果..."
echo "剩余的SmartSmart引用:"
grep -r "SmartSmart" src/examples/ --include="*.cj" | wc -l

echo "🎯 重复前缀修复脚本执行完成！"
